home *** CD-ROM | disk | FTP | other *** search
- The enclosed files include an assy. routine for merging with
- GFA so that you can produce multi-colored sprites of any size
- quickly and efficiently. Files that should be included in this
- arc file are:
-
- F_SPRITE.INL The assy. program to handle the sprite
- conversions.
-
- SPT_SHOW.PRG A simple sample of F_SPRITEL.INL in use.
-
- SPRITE.ASC This text file.
-
- These files are offered for public use. I reserve only my own
- personal right to use and modify the routine as I see fit.
-
- Mike Harrington
- R.HARRINGTO1
- 5/16/92
-
-
- USING THE ROUTINE:
-
- Step 1.
- Create the following GFA statement within your code:
-
- INLINE tsprite%,300
-
- Locate the cursor on the above line, then press the "HELP"
- key. Select "LOAD" from the presented options menu. When the
- file selector box is displayed, select "F_SPRITE.INL" to load the
- assy. routine into your GFA file. The assy. routine will be
- saved along with your code. NOTE: (When you save the program,
- be sure to correct your file name, otherwise "F_SPRITE.GFA" will
- be the default name.
-
-
- Step 2.
- Dimmension an array of 16 integers to hold the current
- register data. Example:
-
- DIM tspt%(16)
-
-
- Step 3.
- Create the following GFA function:
-
- FUNCTION Build$
- Local newspt$
- newspt$=tempbkgd$
- tspt%(1)=VARPTR(newspt$)+6
- tspt%(0)=VARPTR(ctpart$)+6
- tspt%(2)=tspt%(0)+LEN(newspt$)-6
- RCALL tsprite%,tspt%()
- RETURN newspt$
- END FUNCTION
-
-
- Ctpart$ holds a copy of the current sprite as captured by
- the GFA GET x%,y%,ctpart$ command. Tempbkgd$ holds a copy of the
- current background that is to be merged with the sprite. This
- also is a capture of the GFA GET x%,y%,tempbkgd$ command.
- Tempbkgd$ is transfered to newspt$ so that the real background
- is not modified. Then the work begins.
- The memory location of newspt$ and ctpart$ are assigned to
- tspt%(1) and tspt%(0), respectively. Notice that each location
- is adjusted by -6 or 3 words. GFA uses these first 3 words to
- identify the sprite size and the screen rez., so they must not be
- modified. The length of the sprite is stored in tspt%(2).
- Notice that we include the 3 words used by GFA in this statement
- so that we get the full length of the sprite.
- After the assy. routine has merged the two sprites, newspt$
- is passed back to the calling program for use as desired. This
- is still a standard GFA graphic, so any of the normal modes may
- used.
-
-
- Step 4.
- To call the Build$ function, use the following perimeters:
- a) place your sprite (ctpart$) on a black background.
- b) use the GET x,y,ctpart$ command to capture the sprite.
- c) use the GET x,y,tempbkgd$ command to capture the back-
- ground that you wish to merge with the current sprite.
- (NOTE:::
- ctpart$ and tempbkgd$ must be of identical size...
- --------------------------------------------------
- The actual size itself is unimportant.
- d) call the build$ function as follows:
- mysprite$=FN build$
- e) Use the PUT x%,y%,mysprite$ command to place the modified
- sprite.
-
-
-
-
- ABOUT THE SAMPLE PROGRAM:
- SPT_SHOW.PRG is a simple illustration of the above sprite
- generator. A simple multi-colored screen is drawn, then a simple
- sprite will move across the screen. The speed will gradually
- increase to the point that the sprite almost become invisible.
-
-
- Best wishes
- Mike Harrington
-
-
-
-
-